﻿<%@ Page Title="" Language="C#" MasterPageFile="~/settings/SettingsMaster.master" AutoEventWireup="true" Inherits="Settings.Theme.ContainerList"  ValidateRequest="false" Codebehind="ContainerList.aspx.cs" %>
<%@ Register src="../Controls/EntityEdit.ascx" tagname="EntityEdit" tagprefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<script type="text/javascript" src="../Scripts/catchtab.js"></script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h2 class="pagetitle">Pages</h2>

<asp:Literal ID="litBreadcrumb" runat="server" />

<asp:UpdatePanel ID="udpOutterUpdatePanel" runat="server"> 
     <ContentTemplate> 
 
<asp:DataGrid ID="grdContainer" runat="server" AutoGenerateColumns="false" onitemcommand="grdContainer_ItemCommand" onitemdatabound="grdContainer_ItemDataBound"  ShowFooter="true" >
    <Columns>
        <asp:TemplateColumn Visible=false>
            <ItemTemplate>
                <asp:Literal ID="litId" runat="server" Text='<%# Eval("Id") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                
        <asp:TemplateColumn HeaderText="Page name">
            <ItemTemplate>
                <asp:Literal ID="litName" runat="server" Text='<%# Eval("Name") %>' />.html
            </ItemTemplate>
        </asp:TemplateColumn>              
        <asp:TemplateColumn HeaderText="Title">
            <ItemTemplate>
                <asp:Literal ID="litTitle" runat="server" Text='<%# Eval("Title") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                
        <asp:TemplateColumn ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
            <ItemTemplate>
                <asp:Button id="btnEdit" Text="Edit" ButtonType="PushButton" CssClass="greenbutton" CommandName="Edit"   runat="server"  />
                <asp:Button id="btnHtml" Text="Html" ButtonType="PushButton" CssClass="greenbutton" CommandName="Html"   runat="server"  />
                <asp:Button id="btnDelete" Text="Delete" ButtonType="PushButton" CssClass="redbutton" CommandName="Delete"  runat="server"  />    
            </ItemTemplate>
            <FooterTemplate>
                <asp:Button id="btnNew" Text="New" ButtonType="PushButton" CssClass="yellowbutton" CommandName="New"  runat="server"  />
            </FooterTemplate>
        </asp:TemplateColumn>
    </Columns>
</asp:DataGrid>

<h3>Blocks</h3>
<asp:DataGrid ID="grdBlock" runat="server" AutoGenerateColumns="false"  ShowFooter="true" onitemcommand="grdBlock_ItemCommand" onitemdatabound="grdBlock_ItemDataBound"   >
    <Columns>
        <asp:TemplateColumn Visible=false>
            <ItemTemplate>
                <asp:Literal ID="litId" runat="server" Text='<%# Eval("Id") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                
        <asp:TemplateColumn HeaderText="Code">
            <ItemTemplate>
                <asp:Literal ID="litCode" runat="server" Text='<%# Eval("Code") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                
        <asp:TemplateColumn HeaderText="Description">
            <ItemTemplate>
                <asp:Literal ID="litDescription" runat="server" Text='<%# Eval("Description") %>' />
            </ItemTemplate>
        </asp:TemplateColumn>                
        <asp:TemplateColumn ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
            <ItemTemplate>
                <asp:Button id="btnEdit" Text="Edit" ButtonType="PushButton" CssClass="greenbutton" CommandName="Edit"   runat="server"  />
                <asp:Button id="btnHtml" Text="Html" ButtonType="PushButton" CssClass="greenbutton" CommandName="Html"   runat="server"  />
                <asp:Button id="btnDelete" Text="Delete" ButtonType="PushButton" CssClass="redbutton" CommandName="Delete"  runat="server"  />    
            </ItemTemplate>
            <FooterTemplate>
                <asp:Button id="btnNew" Text="New" ButtonType="PushButton" CssClass="yellowbutton" CommandName="New"  runat="server"  />
            </FooterTemplate>
        </asp:TemplateColumn>
    </Columns>
</asp:DataGrid>


    <ajaxToolkit:ModalPopupExtender runat="server" 
        ID="mpeTextEdit" 
        TargetControlID="dummy" 
        PopupControlID="pnlModalPopUpPanel" 
        BackgroundCssClass="modalBackground"                        
        DropShadow="false"
        PopupDragHandleControlID="lblTitle"
        /> 

    <input id="dummy" type="button" style="display: none" runat="server" /> 

     <asp:Panel ID="pnlModalPopUpPanel" runat="server" CssClass="windowStyle"  style="display:none;" >             
        <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional"> 
            <ContentTemplate>     
                <asp:Label ID="lblTitle" runat="server" Text="Page title"  CssClass="title" />
                <asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/dialog-greentick.png" style="position:absolute; top: -10px; right:30px;" Text="Save" OnClick="btnSave_Click" />
                <asp:TextBox ID="txtBox" runat="server" width="950" Height="500" TextMode="MultiLine" style="border: 1px solid #ccc; font-family: Lucida Console, Monospace; padding: 5px;"  /><br />
                <asp:Literal ID="litErrors" runat="server" />
            </ContentTemplate>       
        </asp:UpdatePanel> 
    </asp:Panel>
    

    <ajaxToolkit:ModalPopupExtender runat="server" 
        ID="mpeEditEntity" 
        TargetControlID="dummy2" 
        PopupControlID="pnlEditEntity" 
        BackgroundCssClass="modalBackground"                        
        DropShadow="false"
        /> 

     <input id="dummy2" type="button" style="display: none" runat="server" /> 
     
     <asp:Panel ID="pnlEditEntity" runat="server" CssClass="modalPopup"  style="display:none;" >             
        <asp:UpdatePanel ID="UpdatePanel1" runat="Server" UpdateMode="Conditional"> 
            <ContentTemplate>     
                <asp:ImageButton ID="Imagebutton1" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                <uc1:EntityEdit ID="editContainer" runat="server" Caption="Container" OnUpdate="editContainer_Update"   />
                <uc1:EntityEdit ID="editBlock" runat="server"     Caption="Block" OnUpdate="editContainer_Update"   />
            </ContentTemplate>       
        </asp:UpdatePanel> 
    </asp:Panel>
    
   </ContentTemplate> 
</asp:UpdatePanel> 

</asp:Content>

